package database;

import java.sql.Connection;
import java.sql.DriverManager;

public class AccesoDB {

    private AccesoDB() {
    }

    public static Connection getConnection() throws Exception {
        Connection cn;
        // --------------------------------------------------
        // Paso 1: Cargar el driver a memoria
        Class.forName("oracle.jdbc.OracleDriver").newInstance();
        // Paso 2: Obtener el objeto Connection
        String url = "jdbc:oracle:thin:@localhost:1521:XE";
        cn = DriverManager.getConnection(url, "hr", "hr");
        // --------------------------------------------------
        return cn;
    }
}
